//index.js
//获取应用实例
const app = getApp()

Page({
  data: {
    bannerData:[],
    indicatoractivecolor:"#1296db",
    bannerData1:[],
    displaymultipleitems:2.4,
    subArr:[]
  },
  onLoad(){
    var that=this;
    wx.showToast({
      title: '加载中....',
      icon: "loading",
      duration: 10000
    });
    wx.request({
      url: 'https://api2.bearead.com/list/found_banner_head',
      data: {},
      header: {
        'content-type': 'application/json'
      },
      success:function(res){
        that.setData({
          bannerData:res.data.data.banner_head
        })
      }
    }),
      wx.request({
        url: 'https://api2.bearead.com/list/found_banner_head2',
        data: {},
        header: {
          'content-type': 'application/json'
        },
        success: function (res) {
          that.setData({
            bannerData1: res.data.data.banner_head_2
          })
        }
      }),
      wx.request({
      url: 'https://apph.bearead.com/find/find-list',
        data: {},
        header: {
          'content-type': 'application/json'
        },
        success: function (res) {
          wx.hideToast();
          that.setData({
            subArr: res.data.data
          })
        }
      })
  },
 onReady(){
   
 },
 onShareAppMessage(){
   
 },
  toDetail(event){
    var detid = event.currentTarget.dataset.detid;
    // console.log(detid)
    wx.navigateTo({
      url: '../book/book?id=' + detid
    })
  }
})
